import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login')
  },
  {
    path: '/',
    name: '/',
    component: () => import('../layout'),
    redirect: '/message',
    children: [
      {
        path: 'message',
        name: 'message',
        component: () => import('@/views/message/index.vue')
      },
      {
        path: 'staff',
        name: 'staff',
        component: () => import('@/views/staff/index.vue')
      },
      {
        path: 'machine',
        name: 'machine',
        component: () => import('@/views/machine/index.vue')
      },

      {
        path: 'pay',
        name: 'pay',
        component: () => import('@/views/pay/index.vue')
      },

      {
        path: 'notice',
        name: 'notice',
        component: () => import('@/views/notice/index.vue')
      },

      {
        path: 'orderanalysis',
        name: 'orderanalysis',
        component: () => import('@/views/sharelock_analysis/order_analysis.vue')
      },

      {
        path: 'chargerules',
        name: 'chargerules',
        component: () => import('@/views/chargerules/index.vue')
      },

      {
        path: 'sharemap',
        name: 'sharemap',
        component: () => import('@/views/sharemap/index.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
